<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@taglib prefix="s" uri="strutsTags"%>
<%@taglib prefix="ty" uri="/wyzzTags"%>

<table id="attend_monthly_table" style="border-top: 0px" cellpadding="0"
	cellspacing="0" border="0" class="gridtableList">
	<tr id="gridtableHead">
		<s:if test="period.attpStatus==0">
			<th align="center" width="3%">
				<input id="id_check_all" name='id_check_all' class="checkbox"
					type="checkbox"
					onclick="HRMCommon.checkAllByName('attend.ids','id_check_all');"
					value="0">
			</th>
		</s:if>
		<th>
			<a onclick="HRMCommon.order_submit('emp.empDistinctNo');">工号</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='emp.empDistinctNo_img'>
		</th>
		<th>
			<a onclick="HRMCommon.order_submit('emp.empName');">姓名</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='emp.empName_img'>
		</th>
		<th>
			<a onclick="HRMCommon.order_submit('empOrgDept.departmentName');">部门</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='empOrgDept.departmentName_img'>
		</th>
		<s:if test="single!=null && single=='yes'">
			<th>
				<a onclick="HRMCommon.order_submit('attmYearmonth');">年月</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmYearmonth_img'>
			</th>
		</s:if>

		<s:if test="searchMode == 0">
			<th>
				<a onclick="HRMCommon.order_submit('attmDutyDays');">全勤(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmDutyDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmOnDutyDays');">出勤(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmOnDutyDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmOffDutyDays');">缺勤(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmOffDutyDays_img'>
			</th>
		</s:if>
		<s:else>
			<th>
				<a onclick="HRMCommon.order_submit('attmDutyHours');">全勤(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmDutyHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmOnDutyHours');">出勤(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmOnDutyHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmOffDutyHours');">缺勤(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmOffDutyHours_img'>
			</th>
		</s:else>
		<th>
			<a onclick="HRMCommon.order_submit('attmLateTimes');">迟到(次)</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='attmLateTimes_img'>
		</th>
		<th>
			<a onclick="HRMCommon.order_submit('attmEarlyLeave');">早退(次)</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='attmEarlyLeave_img'>
		</th>
		<s:if test="searchMode == 0">
			<th>
				<a onclick="HRMCommon.order_submit('attmAbsentDays');">旷工(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmAbsentDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveDays');">请假(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveAnnualDays');">年假(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveAnnualDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveCasualDays');">事假(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveCasualDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveSickDays');">病假(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveSickDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveSick01Days');">病假住院(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveSick01Days_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveSick02Days');">带薪病假(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveSick02Days_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveWeddingDays');">婚假(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveWeddingDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveMaternityDays');">产假(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveMaternityDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveTiaoxiu01Days');">调休(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveTiaoxiu01Days_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveOtherDays');">其他请假(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveOtherDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveTravelDays');">出差(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveTravelDays_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveOuterDays');">因公外出(天)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveOuterDays_img'>
			</th>
		</s:if>
		<s:else>
			<th>
				<a onclick="HRMCommon.order_submit('attmAbsentHours');">旷工(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmAbsentHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveHours');">请假(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveAnnualHours');">年假(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveAnnualHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveCasualHours');">事假(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveCasualHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveSickHours');">病假(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveSickHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveSick01Hours');">病假住院(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveSick01Hours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveSick02Hours');">带薪病假(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveSick02Hours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveWeddingHours');">婚假(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveWeddingHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveMaternityHours');">产假(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveMaternityHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveTiaoxiu01Hours');">调休(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveTiaoxiu01Hours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveOtherHours');">其他请假(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveOtherHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveTravelHours');">出差(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveTravelHours_img'>
			</th>
			<th>
				<a onclick="HRMCommon.order_submit('attmLeaveOuterHours');">因公外出(小时)</a>
				<img src='resource/images/arrow_.gif' width='8' height='10'
					id='attmLeaveOuterHours_img'>
			</th>
		</s:else>
		<th>
			<a onclick="HRMCommon.order_submit('attmOvertimeHours');">加班(小时)</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='attmOvertimeHours_img'>
		</th>
		<th>
			<a onclick="HRMCommon.order_submit('attmOtNormalHours');">普通加班(小时)</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='attmOtNormalHours_img'>
		</th>
		<th>
			<a onclick="HRMCommon.order_submit('attmOtWeekendHours');">周末加班(小时)</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='attmOtWeekendHours_img'>
		</th>
		<th>
			<a onclick="HRMCommon.order_submit('attmOtHolidayHours');">节假日加班(小时)</a>
			<img src='resource/images/arrow_.gif' width='8' height='10'
				id='attmOtHolidayHours_img'>
		</th>
		<s:if test="period.attpStatus==0">
			<th>
				操作
			</th>
		</s:if>
	</tr>
	<s:if test="!attendmonthlyList.isEmpty()">
		<s:iterator value="attendmonthlyList" status="index">
			<s:hidden id="%{'empName'+(#index.count)}" name="hiddenName"
				value="%{attmEmpId.empName}" />
			<s:hidden id="%{'empId'+(#index.count)}" name="hiddenName"
				value="%{attmEmpId.id}" />
			<s:hidden id="%{'id'+(#index.count)}" name="hiddenName" value="%{id}" />
			<s:hidden id="%{'comments'+(#index.count)}" name="hiddenName"
				value="%{attmComments}" />
			<tr>
				<%--员工信息层的数据--%>
				<s:if test="period.attpStatus==0">
					<td align="center" width="3%">
						<input id="attend.ids" name="attend.ids" class="checkbox"
							type="checkbox" value="<s:property value='id'/>" />
					</td>
				</s:if>
				<td id="empDistinctNo<s:property value="#index.count"/>"
					align="center" nowrap="nowrap">
					<s:property value="attmEmpId.empDistinctNo" />
				</td>
				<td nowrap="nowrap" id="name<s:property value="#index.count"/>">
					<span
						TITLE="员工编号：<s:property value='attmEmpId.empDistinctNo'/>
部门：<s:property value='attmEmpId.empDeptNo.departmentName'/>
职位：<s:property value='attmEmpId.empPbNo.pbName'/>
所属地区：<s:property value='attmEmpId.empLocationNo.locationName'/> 
用工形式：<s:property value='%{getEmpType(attmEmpId.empType.id)}'/>" />
						<a class="listViewTdLinkS1"
						onclick="dwrAttendDailyMemory('<s:property value="attmYearmonth"/>', '<s:property value="attmEmpId.id"/>','<s:property value="attmEmpId.empName"/>')"><s:property
								value="attmEmpId.empName" /> </a>
				</td>
				<td id="empDeptNameo<s:property value="#index.count"/>"
					align="center" nowrap="nowrap">
					<s:property value="attmEmpId.empDeptNo.departmentName" />
				</td>
				<s:if test="single!=null && single=='yes'">
					<td id="attmYearmonth<s:property value="#index.count"/>"
						align="center" nowrap="nowrap">
						<s:property value="attmYearmonth" />
					</td>
				</s:if>
				<s:if test="searchMode == 0">
					<td id="dutyDaysTD<s:property value="#index.count"/>" align="right"
						nowrap="nowrap">
						<span id="dutyDays<s:property value="#index.count"/>"> <s:property
								value="formatBD(attmDutyDays)" /> </span>
						<s:if test="status!=null">
							<img
								onclick="myshowconfigDiv('<s:property value="#index.count"/>');"
								id="searchImg<s:property value="#index.count"/>" alt="查看详细"
								title="查看详细" class="urlimg" src="resource/images/Search.gif">
						</s:if>
					</td>
					<td id="onDutyDays<s:property value="#index.count"/>" align="right">
						<s:property value="formatBD(attmOnDutyDays)" />
					</td>
					<td id="offDutyDays<s:property value="#index.count"/>"
						align="right">
						<s:property value="formatBD(attmOffDutyDays)" />
					</td>
				</s:if>
				<s:else>
					<td id="dutyHoursTD<s:property value="#index.count"/>"
						align="right" nowrap="nowrap">
						<span id="dutyHours<s:property value="#index.count"/>"> <s:property
								value="formatBD(attmDutyHours)" /> </span>
						<s:if test="status!=null">
							<img
								onclick="myshowconfigDiv('<s:property value="#index.count"/>');"
								id="searchImg<s:property value="#index.count"/>" alt="查看详细"
								title="查看详细" class="urlimg" src="resource/images/Search.gif">
						</s:if>
					</td>
					<td id="onDutyHours<s:property value="#index.count"/>"
						align="right">
						<s:property value="formatBD(attmOnDutyHours)" />
					</td>
					<td id="offDutyHours<s:property value="#index.count"/>"
						align="right">
						<s:property value="formatBD(attmOffDutyHours)" />
					</td>
				</s:else>
				<td id="lateTime<s:property value="#index.count"/>" align="right">
					&nbsp;
					<s:property value="formatBD(attmLateTimes)" />
				</td>
				<td id="EarlyLeaveTime<s:property value="#index.count"/>"
					align="right">
					&nbsp;
					<s:property value="formatBD(attmEarlyLeave)" />
				</td>
				<s:if test="searchMode == 0">
					<td id="AbsentDays<s:property value="#index.count"/>" align="right">
						&nbsp;
						<s:property value="formatBD(attmAbsentDays)" />
					</td>
					<td id="LeaveDays<s:property value="#index.count"/>" align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveDays)" />
					</td>
					<td id="LeaveAnnualDays<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveAnnualDays)" />
					</td>
					<td id="LeaveCasualDays<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveCasualDays)" />
					</td>
					<td id="LeaveSickDays<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveSickDays)" />
					</td>
					<td id="LeaveSick01Days<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveSick01Days)" />
					</td>
					<td id="LeaveSick02Days<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveSick02Days)" />
					</td>
					<td id="LeaveWeddingDays<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveWeddingDays)" />
					</td>
					<td id="MaternityDays<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveMaternityDays)" />
					</td>
					<td id="LeaveTiaoxiu01Days<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveTiaoxiu01Days)" />
					</td>
					<td id="LeaveOtherDays<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveOtherDays)" />
					</td>
					<td id="LeaveTravelDays<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveTravelDays)" />
					</td>
					<td id="LeaveOuterDays<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveOuterDays)" />
					</td>
				</s:if>
				<s:else>
					<td id="AbsentHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmAbsentHours)" />
					</td>
					<td id="LeaveHours<s:property value="#index.count"/>" align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveHours)" />
					</td>
					<td id="LeaveAnnualHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveAnnualHours)" />
					</td>
					<td id="LeaveCasualHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveCasualHours)" />
					</td>
					<td id="LeaveSickHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveSickHours)" />
					</td>
					<td id="LeaveSick01Hours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveSick01Hours)" />
					</td>
					<td id="LeaveSick02Hours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveSick02Hours)" />
					</td>
					<td id="LeaveWeddingHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveWeddingHours)" />
					</td>
					<td id="MaternityHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveMaternityHours)" />
					</td>
					<td id="LeaveTiaoxiu01Hours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveTiaoxiu01Hours)" />
					</td>
					<td id="LeaveOtherHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveOtherHours)" />
					</td>
					<td id="LeaveTravelHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveTravelHours)" />
					</td>
					<td id="LeaveOuterHours<s:property value="#index.count"/>"
						align="right">
						&nbsp;
						<s:property value="formatBD(attmLeaveOuterHours)" />
					</td>
				</s:else>
				<td id="otHours<s:property value="#index.count"/>" align="right">
					&nbsp;
					<s:property value="formatBD(attmOvertimeHours)" />
				</td>
				<td id="OtNormalHours<s:property value="#index.count"/>"
					align="right">
					&nbsp;
					<s:property value="formatBD(attmOtNormalHours)" />
				</td>
				<td id="OtWeekendHours<s:property value="#index.count"/>"
					align="right">
					&nbsp;
					<s:property value="formatBD(attmOtWeekendHours)" />
				</td>
				<td id="OtHolidayHours<s:property value="#index.count"/>"
					align="right">
					&nbsp;
					<s:property value="formatBD(attmOtHolidayHours)" />
				</td>
				<s:if test="single==null && period.attpStatus==0">
					<td align="center"
						id="empOperation<s:property value="#index.count"/>">
						<s:if test="period.attpStatus==0">
							<img
								onclick="delEmpMonthlyRecords('<s:property value="#index.count"/>','<s:property value="id"/>');"
								alt="删除" title="删除" class="urlimg"
								src="resource/images/deletesalaryconf.gif" />
						</s:if>
					</td>
				</s:if>
			</tr>
		</s:iterator>
	</s:if>
	<s:else>
		<tr>
			<!-- 不存在员工考勤记录 -->
			<td colspan="13" align="center">
				<table height="200">
					<tr>
						<td>
							无符合条件的考勤记录！
						</td>
					</tr>
					<s:if test="period==null && single==null">
						<ty:auth auths="401,3 or 401,2">
							<script type="text/javascript" language="javascript">
	var yearMonth = document.getElementById('yearMonth').value;
	if (confirm(yearMonth + "考勤汇总数据不存在，是否要汇总？")) {
		document.searchAttendmonthly.action = "examin/calDailyToAttendmonthly.action";
		document.searchAttendmonthly.submit();
	}
</script>
						</ty:auth>
					</s:if>
				</table>
			</td>
		</tr>
	</s:else>
</table>

<input id="div_empid" type="hidden" name="hiddenName" />
<input id="div_attdId" type="hidden" name="hiddenName" />
<input id="div_rowID" type="hidden" name="hiddenName" />
<!-- 考勤信息汇总 -->
<div id="dlgExaminInfo" class="prompt_div_inline" style="width: 460;">
	<div id="change_stutus_error" class="prompt_div_err"></div>
	<table id="newConfigTable" class="prompt_div_body" width="100%">
		<s:if test="searchMode == 0">
			<tr>
				<td>
					全勤(天):
				</td>
				<td>
					<input type="text" id="attmDutyDays_div" name="attmDutyDays_div"
						value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					年假(天):
				</td>
				<td>
					<input type="text" id="attmLeaveAnnualDays_div"
						name="attmLeaveAnnualDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</tr>
			<tr>
				<td>
					出勤(天):
				</td>
				<td>
					<input type="text" id="attmOnDutyDays_div"
						name="attmOnDutyDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					事假(天):
				</td>
				<td>
					<input type="text" id="attmLeaveCasualDays_div"
						name="attmLeaveCasualDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</tr>
			<tr>
				<td>
					缺勤(天):
				</td>
				<td>
					<input type="text" id="attmOffDutyDays_div"
						name="attmOffDutyDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					病假(天):
				</td>
				<td>
					<input type="text" id="attmLeaveSickDays_div"
						name="attmLeaveSickDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</tr>
			<tr>
				<td>
					旷工(天):
				</td>
				<td>
					<input type="text" id="attmAbsentDays_div"
						name="attmAbsentDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					病假住院(天):
				</td>
				<td>
					<input type="text" id="attmLeaveSick01Days_div"
						name="attmLeaveSick01Days_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</tr>
		</s:if>
		<s:else>
			<tr>
				<td>
					全勤(小时):
				</td>
				<td>
					<input type="text" id="attmDutyHours_div" name="attmDutyHours_div"
						value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					年假(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveAnnualHours_div"
						name="attmLeaveAnnualHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</tr>
			<tr>
				<td>
					出勤(小时):
				</td>
				<td>
					<input type="text" id="attmOnDutyHours_div"
						name="attmOnDutyHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					事假(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveCasualHours_div"
						name="attmLeaveCasualHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</tr>
			<tr>
				<td>
					缺勤(小时):
				</td>
				<td>
					<input type="text" id="attmOffDutyHours_div"
						name="attmOffDutyHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					病假(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveSickHours_div"
						name="attmLeaveSickHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</tr>
			<tr>
				<td>
					旷工(小时):
				</td>
				<td>
					<input type="text" id="attmAbsentHours_div"
						name="attmAbsentHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					病假住院(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveSick01Hours_div"
						name="attmLeaveSick01Hours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</tr>
		</s:else>
		<tr>
			<td>
				迟到(次):
			</td>
			<td>
				<input type="text" id="attmLateTimes_div" name="attmLateTimes_div"
					value="" size="5" maxlength="5" onkeypress="MKeyIsNumber(this);"
					style='text-align: right'>
			</td>
			<s:if test="searchMode == 0">
				<td>
					带薪病假(天):
				</td>
				<td>
					<input type="text" id="attmLeaveSick02Days_div"
						name="attmLeaveSick02Days_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:if>
			<s:else>
				<td>
					带薪病假(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveSick02Hours_div"
						name="attmLeaveSick02Hours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:else>
		</tr>
		<tr>
			<td>
				早退(次):
			</td>
			<td>
				<input type="text" id="attmEarlyLeave_div" name="attmEarlyLeave_div"
					value="" size="5" maxlength="5" onkeypress="MKeyIsNumber(this);"
					style='text-align: right'>
			</td>
			<s:if test="searchMode == 0">
				<td>
					调休(天):
				</td>
				<td>
					<input type="text" id="attmLeaveTiaoxiu01Days_div"
						name="attmLeaveTiaoxiu01Days_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:if>
			<s:else>
				<td>
					调休(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveTiaoxiu01Hours_div"
						name="attmLeaveTiaoxiu01Hours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:else>
		</tr>
		<tr>
			<td>
				普通加班(小时):
			</td>
			<td>
				<input type="text" id="attmOtNormalHours_div"
					name="attmOtNormalHours_div" value="" size="5" maxlength="5"
					onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
					style='text-align: right'>
			</td>
			<s:if test="searchMode == 0">
				<td>
					婚假(天):
				</td>
				<td>
					<input type="text" id="attmLeaveWeddingDays_div"
						name="attmLeaveWeddingDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:if>
			<s:else>
				<td>
					婚假(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveWeddingHours_div"
						name="attmLeaveWeddingHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:else>
		</tr>
		<tr>
			<td>
				周末加班(小时):
			</td>
			<td>
				<input type="text" id="attmOtWeekendHours_div"
					name="attmOtWeekendHours_div" value="" size="5" maxlength="5"
					onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
					style='text-align: right'>
			</td>
			<s:if test="searchMode == 0">
				<td>
					产假(天):
				</td>
				<td>
					<input type="text" id="attmLeaveMaternityDays_div"
						name="attmLeaveMaternityDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:if>
			<s:else>
				<td>
					产假(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveMaternityHours_div"
						name="attmLeaveMaternityHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:else>
		</tr>
		<tr>
			<td>
				节假日加班(小时):
			</td>
			<td>
				<input type="text" id="attmOtHolidayHours_div"
					name="attmOtHolidayHours_div" value="" size="5" maxlength="5"
					onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
					style='text-align: right'>
			</td>
			<s:if test="searchMode == 0">
				<td>
					其他请假(天):
				</td>
				<td>
					<input type="text" id="attmLeaveOtherDays_div"
						name="attmLeaveOtherDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:if>
			<s:else>
				<td>
					其他请假(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveOtherHours_div"
						name="attmLeaveOtherHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:else>
		</tr>
		<tr>
			<s:if test="searchMode == 0">
				<td>
					出差(天):
				</td>
				<td>
					<input type="text" id="attmLeaveTravelDays_div"
						name="attmLeaveTravelDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					因公外出(天):
				</td>
				<td>
					<input type="text" id="attmLeaveOuterDays_div"
						name="attmLeaveOuterDays_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:if>
			<s:else>
				<td>
					出差(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveTravelHours_div"
						name="attmLeaveTravelHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
				<td>
					因公外出(小时):
				</td>
				<td>
					<input type="text" id="attmLeaveOuterHours_div"
						name="attmLeaveOuterHours_div" value="" size="5" maxlength="5"
						onkeypress="HRMCommon.checkOnKeyDownFloat(event, this);"
						style='text-align: right'>
				</td>
			</s:else>
		</tr>
		<s:iterator value="attdConfList" status="index">
			<s:if test="#index.odd">
				<tr>
			</s:if>
			<td>
				<s:property value="eadcFieldName" />
				:
			</td>
			<td>
				<s:if test="eadcFieldType=='number'">
					<input type="text" id="attmField<s:property value="eadcSeq"/>"
						name="attmField<s:property value="eadcSeq"/>" value=""
						maxLength="15" size="8" style='text-align: right'>
				</s:if>
			</td>
			<s:if test="#index.last && #index.odd">
				<td />
				<td />
			</s:if>
			<s:if test="#index.even">
				</tr>
			</s:if>
		</s:iterator>
		<tr>
			<td align="left" align="center">
				备注:
			</td>
			<td align="left" colspan="3">
				<textarea name="attmComments_div" id="attmComments_div" rows="3"
					cols="38"></textarea>
			</td>
		</tr>
		<tr>
			<td colspan="4" class="prompt_div_bottom">
				<s:if test="status==0">
					<input id="div_btnSubmit" name="hiddenName" class="button"
						type="button" onclick="saveAttend();" value="确定">
					<input id="div_btnCalculate" name="hiddenName" class="button"
						type="button" onclick="initAttendmonthly();" value="重置">
				</s:if>
				<input class="button" type="button" name="hiddenName"
					onclick="HRMCommon.closeDialog('dlgExaminInfo')" value="取消">
			</td>
		</tr>
	</table>
	<iframe scrolling="no"
		style="position: absolute; z-index: -1; width: expression(this .           parentNode .           offsetWidth-2); height: expression(this .           parentNode .           offsetHeight-2); top: 0px; left: 0px; width: 430px; height: 120px;"
		frameborder="0"></iframe>
</div>

<script type="text/javascript">
	var flag = document.getElementById("searchMode").value; // 标志是按天还是按小时的（0:按天；1:按小时）
	var suffix, suffixS; // 后缀：天= “_by_days”；或者：小时=“_by_hours”
	if (flag == "0") {
		suffixS = "天";
		suffix = "Days";
	} else {
		suffixS = "小时";
		suffix = "Hours";
	}
	var status = '<s:property value="status"/>';
	/*****************************************************
	 * 点击一条每月考勤记录时，在弹出层中显示该记录的明细
	 * 参数 ： rowId 记录行号
	 * 返回值： 无
	 *****************************************************
	 */
	function myshowconfigDiv(rowId) {
		var empname = document.getElementById('empName' + rowId).value;
		var id = document.getElementById("id" + rowId).value;
		document.getElementById("div_rowID").value = rowId;//每月考勤记录UUID
		document.getElementById("div_empid").value = document
				.getElementById('empId' + rowId).value;//员工ID

		//dwr调用，根据每月考勤记录ID获取记录明细
		DwrForAttend.getEmpAttendmonthly(id, callBack);
		function callBack(msg) {
			if (msg.error) {
				HRMCommon.actionMsgHandler(msg.error);
			} else {
				var data = msg.param_succ;
				setAttmFieldValue(data);

				//自定义字段赋值
				for ( var i = 1; i <= 24; i++) {
					var attmFld = i > 9 ? ("attmField" + i) : ("attmField"
							+ "0" + i);
					if (document.getElementById("attmField" + i) != null) {
						var value = data[attmFld];
						if (value != null)
							document.getElementById("attmField" + i).value = value;
						else
							document.getElementById("attmField" + i).value = "";
					}
				}
				document.getElementById("attmComments_div").value = data.attmComments;//备注

				var temp_div = "dlgExaminInfo";
				HRMCommon.openDialog(temp_div);

				if (status != "0") {
					$("#" + temp_div + " :input[type=text]").attr("readonly",
							"true");
					$("#" + temp_div + " :input[type=text]").addClass(
							"nothinginput");
					$("#attmComments_div").attr("disabled", "true");
				}
				var yearMonthStr = data.attmYearmonth.substring(0, 4) + "年"
						+ data.attmYearmonth.substring(4, 6) + "月";
				$("#" + temp_div).dialog("option", "title",
						"员工" + empname + yearMonthStr + "的考勤汇总信息");
			}
		}
	}

	/*****************************************************
	 * 显示员工一个月每日考勤数据明细
	 * 参数：id 员工编号
	 * 参数：empName 员工姓名
	 * 返回值： 无
	 *****************************************************
	 */
	function dwrAttendDailyMemory(attmYearmonth, id, empName) {
		removeContents();//清空数据

		DwrForAttend.getAttendDailyMemory(id, attmYearmonth, memoryCallBack);
		function memoryCallBack(msg) {
			if (msg.error) {
				HRMCommon.actionMsgHandler(msg.error);
				return;
			}
			var data = msg.param_succ;
			var size = data.length;
			for ( var i = 0; i < size; i++) {
				var tr = createTr(data[i].displayColor);
				var td1 = createDateTd(data[i].examinDate);
				tr.appendChild(td1);//日期
				var td2 = createTd(data[i].shiftName);
				tr.appendChild(td2);//班次
				var td3 = createTimeTd(data[i].onDutyTime);
				tr.appendChild(td3);//上班
				var td4 = createTimeTd(data[i].offDutyTime);
				tr.appendChild(td4);//下班
				var td5;
				if (flag == "0")
					td5 = createTd(data[i].oughtDutyDays);
				else
					td5 = createTd(data[i].oughtDutyHours);
				tr.appendChild(td5);//应出勤
				var td6 = createTd(data[i].lateMinutes);
				tr.appendChild(td6);//迟到
				var td7 = createTd(data[i].earlyMinutes);
				tr.appendChild(td7);//早退
				var td8;
				if (flag == "0")
					td8 = createTd(data[i].absentDays);
				else
					td8 = createTd(data[i].absentTimes);
				tr.appendChild(td8);//缺勤
				var td9;
				if (flag == "0")
					td9 = createTd(data[i].leaveDays);
				else
					td9 = createTd(data[i].leaveHours);
				tr.appendChild(td9);//请假
				var td10 = createTd(data[i].overtimeHours);
				tr.appendChild(td10);//加班
				var td11 = createTd(data[i].comments);
				tr.appendChild(td11);//描述

				document.getElementById('memoryDataArea').appendChild(tr);
			}
			var year = attmYearmonth.substring(0, 4);
			var month = attmYearmonth.substring(4, 6);
			$('#dlgExaminDetail').dialog("option", "title",
					empName + year + '年' + month + '月的考勤明细');
			HRMCommon.openDialog('dlgExaminDetail');
		}
	}

	/*****************************************************
	 * 保存对一条每月考勤记录的修改
	 * 参数 ： rowId 记录行号
	 * 返回值： 无
	 *****************************************************
	 */
	function saveAttend() {
		var id = document.getElementById("div_attdId").value;
		var empId = document.getElementById("div_empid").value;

		// 必填字段检查（全勤、出勤、缺勤）
		var suffixD = suffix + "_div";
		if (document.getElementById("attmDuty" + suffixD).value == ""
				|| document.getElementById("attmDuty" + suffixD).value == null) {
			alert("全勤" + suffixS + "数不能为空！");
			document.getElementById("attmDuty" + suffixD).focus();
			return;
		}
		if (document.getElementById("attmOnDuty" + suffixD).value == ""
				|| document.getElementById("attmOnDuty" + suffixD).value == null) {
			alert("出勤" + suffixS + "数不能为空！");
			document.getElementById("attmOnDuty" + suffixD).focus();
			return;
		}
		if (document.getElementById("attmOffDuty" + suffixD).value == ""
				|| document.getElementById("attmOffDuty" + suffixD).value == null) {
			alert("缺勤" + suffixS + "数不能为空！");
			document.getElementById("attmOffDuty" + suffixD).focus();
			return;
		}

		// 自定义字段验证，只能为数字类型
		for ( var i = 1; i <= 24; i++) {
			if (document.getElementById("attmField" + i)
					&& document.getElementById("attmField" + i).value != '') {
				if (!/^\d+(\.\d{1,2})?$/.test(document
						.getElementById("attmField" + i).value)) {
					alert('非法数字类型！必须为数值，小数位数最多两位。');
					document.getElementById("attmField" + i).focus();
					return;
				}
			}
		}

		var params = {
			id :id,
			attmYearmonth :document.getElementById("yearMonth").value.replace(
					"-", ""),
			attmLateTimes :document.getElementById("attmLateTimes_div").value,
			attmEarlyLeave :document.getElementById("attmEarlyLeave_div").value,
			attmOtNormalHours :document.getElementById("attmOtNormalHours_div").value,
			attmOtWeekendHours :document
					.getElementById("attmOtWeekendHours_div").value,
			attmOtHolidayHours :document
					.getElementById("attmOtHolidayHours_div").value,
			attmComments :document.getElementById("attmComments_div").value,
			attmField01 :document.getElementById("attmField1") == null ? null
					: document.getElementById("attmField1").value,
			attmField02 :document.getElementById("attmField2") == null ? null
					: document.getElementById("attmField2").value,
			attmField03 :document.getElementById("attmField3") == null ? null
					: document.getElementById("attmField3").value,
			attmField04 :document.getElementById("attmField4") == null ? null
					: document.getElementById("attmField4").value,
			attmField05 :document.getElementById("attmField5") == null ? null
					: document.getElementById("attmField5").value,
			attmField06 :document.getElementById("attmField6") == null ? null
					: document.getElementById("attmField6").value,
			attmField07 :document.getElementById("attmField7") == null ? null
					: document.getElementById("attmField7").value,
			attmField08 :document.getElementById("attmField8") == null ? null
					: document.getElementById("attmField8").value,
			attmField09 :document.getElementById("attmField9") == null ? null
					: document.getElementById("attmField9").value,
			attmField10 :document.getElementById("attmField10") == null ? null
					: document.getElementById("attmField10").value,
			attmField11 :document.getElementById("attmField11") == null ? null
					: document.getElementById("attmField11").value,
			attmField12 :document.getElementById("attmField12") == null ? null
					: document.getElementById("attmField12").value,
			attmField13 :document.getElementById("attmField13") == null ? null
					: document.getElementById("attmField13").value,
			attmField14 :document.getElementById("attmField14") == null ? null
					: document.getElementById("attmField14").value,
			attmField15 :document.getElementById("attmField15") == null ? null
					: document.getElementById("attmField15").value,
			attmField16 :document.getElementById("attmField16") == null ? null
					: document.getElementById("attmField16").value,
			attmField17 :document.getElementById("attmField17") == null ? null
					: document.getElementById("attmField17").value,
			attmField18 :document.getElementById("attmField18") == null ? null
					: document.getElementById("attmField18").value,
			attmField19 :document.getElementById("attmField19") == null ? null
					: document.getElementById("attmField19").value,
			attmField20 :document.getElementById("attmField20") == null ? null
					: document.getElementById("attmField20").value,
			attmField21 :document.getElementById("attmField21") == null ? null
					: document.getElementById("attmField21").value,
			attmField22 :document.getElementById("attmField22") == null ? null
					: document.getElementById("attmField22").value,
			attmField23 :document.getElementById("attmField23") == null ? null
					: document.getElementById("attmField23").value,
			attmField24 :document.getElementById("attmField24") == null ? null
					: document.getElementById("attmField24").value
		}

		if (flag == "0") {
			params.attmDutyDays = document.getElementById("attmDutyDays_div").value;
			params.attmOnDutyDays = document
					.getElementById("attmOnDutyDays_div").value;
			params.attmOffDutyDays = document
					.getElementById("attmOffDutyDays_div").value;
			params.attmAbsentDays = document
					.getElementById("attmAbsentDays_div").value;
			params.attmLeaveAnnualDays = document
					.getElementById("attmLeaveAnnualDays_div").value;
			params.attmLeaveTiaoxiu01Days = document
					.getElementById("attmLeaveTiaoxiu01Days_div").value;
			params.attmLeaveCasualDays = document
					.getElementById("attmLeaveCasualDays_div").value;
			params.attmLeaveSickDays = document
					.getElementById("attmLeaveSickDays_div").value;
			params.attmLeaveSick01Days = document
					.getElementById("attmLeaveSick01Days_div").value;
			params.attmLeaveSick02Days = document
					.getElementById("attmLeaveSick02Days_div").value;
			params.attmLeaveOuterDays = document
					.getElementById("attmLeaveOuterDays_div").value;
			params.attmLeaveWeddingDays = document
					.getElementById("attmLeaveWeddingDays_div").value;
			params.attmLeaveMaternityDays = document
					.getElementById("attmLeaveMaternityDays_div").value;
			params.attmLeaveTravelDays = document
					.getElementById("attmLeaveTravelDays_div").value;
			params.attmLeaveOtherDays = document
					.getElementById("attmLeaveOtherDays_div").value;
		} else {
			params.attmDutyHours = document.getElementById("attmDutyHours_div").value;
			params.attmOnDutyHours = document
					.getElementById("attmOnDutyHours_div").value;
			params.attmOffDutyHours = document
					.getElementById("attmOffDutyHours_div").value;
			params.attmAbsentHours = document
					.getElementById("attmAbsentHours_div").value;
			params.attmLeaveAnnualHours = document
					.getElementById("attmLeaveAnnualHours_div").value;
			params.attmLeaveTiaoxiu01Hours = document
					.getElementById("attmLeaveTiaoxiu01Hours_div").value;
			params.attmLeaveCasualHours = document
					.getElementById("attmLeaveCasualHours_div").value;
			params.attmLeaveSickHours = document
					.getElementById("attmLeaveSickHours_div").value;
			params.attmLeaveSick01Hours = document
					.getElementById("attmLeaveSick01Hours_div").value;
			params.attmLeaveSick02Hours = document
					.getElementById("attmLeaveSick02Hours_div").value;
			params.attmLeaveOuterHours = document
					.getElementById("attmLeaveOuterHours_div").value;
			params.attmLeaveWeddingHours = document
					.getElementById("attmLeaveWeddingHours_div").value;
			params.attmLeaveMaternityHours = document
					.getElementById("attmLeaveMaternityHours_div").value;
			params.attmLeaveTravelHours = document
					.getElementById("attmLeaveTravelHours_div").value;
			params.attmLeaveOtherHours = document
					.getElementById("attmLeaveOtherHours_div").value;
		}

		DwrForAttend.saveEmpAttendmonthly(params, empId, flag, savecallBack);
		function savecallBack(msg) {
			if (msg.error) {
				HRMCommon.actionMsgHandler(msg.error);
			} else {
				HRMCommon.actionMsgHandler(msg.success);

				var data = msg.param_succ;
				var id = data.id;
				var rowId = document.getElementById("div_rowID").value;
				document.getElementById("id" + rowId).value = id;
				document.getElementById("div_attdId").value = id;

				if (flag == "0") {
					HRMCommon.closeDialog('dlgExaminInfo');
					setTdValue("dutyDays" + rowId, data.attmDutyDays);//全勤
					setTdValue("onDutyDays" + rowId, data.attmOnDutyDays);//出勤
					setTdValue("offDutyDays" + rowId, data.attmOffDutyDays);//缺勤
					setTdValue("AbsentDays" + rowId, data.attmAbsentDays);//旷工
					setTdValue("LeaveDays" + rowId, data.attmLeaveDays);//请假总时间
					setTdValue("LeaveAnnualDays" + rowId,
							data.attmLeaveAnnualDays);//年假
					setTdValue("LeaveCasualDays" + rowId,
							data.attmLeaveCasualDays);//事假
					setTdValue("LeaveSickDays" + rowId, data.attmLeaveSickDays);//病假
					setTdValue("LeaveSick01Days" + rowId,
							data.attmLeaveSick01Days);//病假住院
					setTdValue("LeaveSick02Days" + rowId,
							data.attmLeaveSick02Days);//病假住院
					setTdValue("LeaveWeddingDays" + rowId,
							data.attmLeaveWeddingDays);//婚假
					setTdValue("MaternityDays" + rowId,
							data.attmLeaveMaternityDays);//产假
					setTdValue("LeaveTravelDays" + rowId,
							data.attmLeaveTravelDays);//出差
					setTdValue("LeaveOuterDays" + rowId,
							data.attmLeaveOuterDays);//因公外出
					setTdValue("LeaveTiaoxiu01Days" + rowId,
							data.attmLeaveTiaoxiu01Days);//调休
					setTdValue("LeaveOtherDays" + rowId,
							data.attmLeaveOtherDays);//其他请假

				} else {
					HRMCommon.closeDialog('dlgExaminInfo');
					setTdValue("dutyHours" + rowId, data.attmDutyHours);//全勤
					setTdValue("onDutyHours" + rowId, data.attmOnDutyHours);//出勤
					setTdValue("offDutyHours" + rowId, data.attmOffDutyHours);//缺勤	
					setTdValue("AbsentHours" + rowId, data.attmAbsentHours);//旷工
					setTdValue("LeaveHours" + rowId, data.attmLeaveHours);//请假总时间
					setTdValue("LeaveAnnualHours" + rowId,
							data.attmLeaveAnnualHours);//年假
					setTdValue("LeaveCasualHours" + rowId,
							data.attmLeaveCasualHours);//事假
					setTdValue("LeaveSickHours" + rowId,
							data.attmLeaveSickHours);//病假
					setTdValue("LeaveSick01Hours" + rowId,
							data.attmLeaveSick01Hours);//病假住院
					setTdValue("LeaveSick02Hours" + rowId,
							data.attmLeaveSick02Hours);//病假住院
					setTdValue("LeaveWeddingHours" + rowId,
							data.attmLeaveWeddingHours);//婚假
					setTdValue("MaternityHours" + rowId,
							data.attmLeaveMaternityHours);//产假
					setTdValue("LeaveTravelHours" + rowId,
							data.attmLeaveTravelHours);//出差
					setTdValue("LeaveOuterHours" + rowId,
							data.attmLeaveOuterHours);//因公外出
					setTdValue("LeaveTiaoxiu01Hours" + rowId,
							data.attmLeaveTiaoxiu01Hours);//调休
					setTdValue("LeaveOtherHours" + rowId,
							data.attmLeaveOtherHours);//其他请假		
				}
				setTdValue("lateTime" + rowId, data.attmLateTimes);//迟到
				setTdValue("EarlyLeaveTime" + rowId, data.attmEarlyLeave);//早退
				setTdValue("OtNormalHours" + rowId, data.attmOtNormalHours);//普通加班
				setTdValue("OtWeekendHours" + rowId, data.attmOtWeekendHours);//周末加班
				setTdValue("OtHolidayHours" + rowId, data.attmOtHolidayHours);//节假日加班
				setTdValue("otHours" + rowId, data.attmOvertimeHours);//加班总时间
			}
		}
	}

	// 重新计算
	function initAttendmonthly() {
		var date = HRMCommon.checkY_M(document.getElementById("yearMonth"));
		if (date == null)
			return;

		var empId = document.getElementById("div_empid").value;
		DwrForAttend.recalcEmpAttendmonthly(date, empId, callback);

		function callback(data) {
			setAttmFieldValue(data);
		}
	}

	// 合并setFieldValue函数，用来设置div中与天/小时相关的字段
	function setAttmFieldValue(data) {
		setFieldValue(data, "attmDuty" + suffix);//本月应出勤天数/小时数
		setFieldValue(data, "attmOnDuty" + suffix);//本月实际出勤天数/小时数
		setFieldValue(data, "attmOffDuty" + suffix);//本月缺勤天数/小时数
		setFieldValue(data, "attmLateTimes");//迟到次数
		setFieldValue(data, "attmEarlyLeave");//早退次数
		setFieldValue(data, "attmAbsent" + suffix);//旷工天数/小时数

		setFieldValue(data, "attmLeaveAnnual" + suffix);//年假天数/小时数
		setFieldValue(data, "attmLeaveTiaoxiu01" + suffix);//调休假天数/小时数
		setFieldValue(data, "attmLeaveCasual" + suffix);//事假天数/小时数
		setFieldValue(data, "attmLeaveSick" + suffix);//病假天数/小时数
		setFieldValue(data, "attmLeaveSick01" + suffix);//病假住院天数/小时数
		setFieldValue(data, "attmLeaveSick02" + suffix);//带薪病假天数/小时数
		setFieldValue(data, "attmLeaveWedding" + suffix);//婚假天数/小时数
		setFieldValue(data, "attmLeaveMaternity" + suffix);//产假天数/小时数
		setFieldValue(data, "attmLeaveTravel" + suffix);//出差天数/小时数
		setFieldValue(data, "attmLeaveOuter" + suffix);//因公外出天数/小时数
		setFieldValue(data, "attmLeaveOther" + suffix);//其他请假天数/小时数

		setFieldValue(data, "attmOtNormalHours");//普通加班小时数
		setFieldValue(data, "attmOtWeekendHours");//周末加班小时数
		setFieldValue(data, "attmOtHolidayHours");//节假日加班小时数
	}

	/*****************************************************
	 * 设置td元素的值
	 * tdId：td元素的id
	 * value:要设置的内容（数值）
	 ******************************************************/
	function setTdValue(tdId, value, noconvert) {
		if (value != null) {
			if (noconvert == null)
				document.getElementById(tdId).innerHTML = parseFloat(value)
						.toFixed(1);
			else
				document.getElementById(tdId).innerHTML = value;
		} else {
			document.getElementById(tdId).innerHTML = "";
		}
	}

	/*****************************************************
	 * 设置form表单元素的值
	 * fieldId：表单元素的id
	 * value:要设置的内容（数值）
	 ******************************************************/
	function setFieldValue(data, fieldId, noconvert) {
		var value = eval("data." + fieldId);
		if (value != null) {
			if (noconvert == null)
				document.getElementById(fieldId + "_div").value = parseFloat(
						value).toFixed(1);
			else
				document.getElementById(fieldId + "_div").value = value;
		} else {
			document.getElementById(fieldId + "_div").value = "";
		}
	}

	/*****************************************************
	 * 删除一条每月考勤汇总数据，用户确认后提交表单，返回每月考勤查询页面
	 * 参数：rowId  行号
	 * 参数：attmId 每月考勤记录uuid
	 * 返回值： 无(在search_attendmonthly_by_day.jsp和by_hour调用)
	 *****************************************************
	 */
	function delEmpMonthlyRecords(rowId, attmId) {
		var date = HRMCommon.checkY_M(document.getElementById("yearMonth"));
		if (date == null)
			return;

		if (!confirm("确定要删除" + document.getElementById('empName' + rowId).value
				+ date + "的当月考勤汇总么？")) {
			return false;
		}
		document.getElementById("delAttendIds").value = "'" + attmId + "'";
		document.searchAttendmonthly.action = "examin/deleteAttendmonthly.action";
		document.searchAttendmonthly.submit();
	}

	/*****************************************************
	 * 将员工每日考勤明细弹出层中的内容清空
	 * 返回值： 无  在by_hour by_day中调用
	 *****************************************************
	 */
	function removeContents() {
		if (!document.getElementById('memoryDataArea').childNodes.length)
			return;
		var ind = document.getElementById('memoryDataArea').childNodes.length;
		for ( var i = ind - 1; i >= 0; i--) {
			document.getElementById('memoryDataArea').removeChild(
					document.getElementById('memoryDataArea').childNodes[i]);
		}
	}

	//创建一个TR(被by_day和by_hour调用)
	function createTr(color) {
		var tr = document.createElement("tr");
		tr.style.color = color;
		return tr;
	}

	//创建一个TD，用来显示时间，格式为hh:ss(被by_day和by_hour调用)
	function createTimeTd(data) {
		var td = document.createElement("td");
		if (data == null) {
			data = "";
			td.innerHTML = data;
			return td;
		}

		var date = new Date(data);
		var hour = date.getHours();
		var minute = date.getMinutes();
		if (hour < 10) {
			hour = "0" + hour;
		}
		if (minute < 10) {
			minute = "0" + minute;
		}
		td.innerHTML = hour + ":" + minute;
		return td;
	}

	//创建一个TD，用来普通文本
	function createTd(data) {
		var td = document.createElement("td");
		if (data == null) {
			data = "";
		}
		//data = new Date(data);
		td.innerHTML = data;
		return td;
	}

	//创建一个TD，用来显示日期，格式为yyyy-MM-dd
	function createDateTd(data) {
		var td = document.createElement("td");
		var date = new Date(data);
		var year = date.getYear();
		if (!isIE()) {
			year = year + 1900;
		}
		var month = date.getMonth() + 1;
		if (month < 10) {
			month = "0" + month;
		}
		var day = date.getDate();
		if (day < 10) {
			day = "0" + day;
		}
		td.innerHTML = year + "-" + month + "-" + day;
		return td;
	}

	// 批量删除每月考勤数据；
	function batchDelAttend() {
		var ids = HRMCommon.getCheckboxByName('attend.ids');
		if (ids.length == 0) {
			alert("请选择要删除的每月考勤记录！");
			return;
		}

		if (!confirm("您确定要删除选中的考勤记录吗？"))
			return;

		document.getElementById("delAttendIds").value = ids;
		document.searchAttendmonthly.action = "examin/deleteAttendmonthly.action";
		document.searchAttendmonthly.submit();
	}
</script>
